﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Cs期中作业
{
    public partial class 主菜单 : Form
    {
        public 主菜单()
        {
            InitializeComponent();
        }
        宿舍管理 宿舍;
        学生信息 学生;
        入住管理 入住;
        private void Button1_Click(object sender, EventArgs e)
        {
            if (学生 == null)
                学生 = new 学生信息();
            this.Hide();
            学生.Show();
        }

        private void Button2_Click(object sender, EventArgs e)
        {
            if (宿舍 == null)
                宿舍 = new 宿舍管理();
            this.Hide();
            宿舍.Show();
        }

        private void Button3_Click(object sender, EventArgs e)
        {
            if (入住 == null)
                入住 = new 入住管理();
            this.Hide();
            入住.Show();
        }

        private void Button4_Click(object sender, EventArgs e)
        {
            /*FormClosingEventArgs Fe = new FormClosingEventArgs(CloseReason.None, false);
            主菜单_FormClosing(this, Fe);*/
            this.Close();
        }

        private void 主菜单_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (MessageBox.Show("是否真的要退出？", "乃确定不是手滑了咩？", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.No)
                e.Cancel = true;
            else
                Application.Exit();
        }
    }
}
